package com.sanjin.controller;

import com.baomidou.mybatisplus.extension.api.ApiController;
import com.sanjin.common.contants.HttpStatus;
import com.sanjin.common.result.Result;
import com.sanjin.domain.UmsSysUser;
import com.sanjin.service.UmsSysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 后台用户表(UmsSysUser)表控制层
 *
 * @author makejava
 * @since 2024-05-13 16:00:12
 */
@RestController
@RequestMapping("/ums/sysUser")
public class UmsSysUserController extends ApiController {
    /**
     * 服务对象
     */
    @Autowired
    private UmsSysUserService umsSysUserService;

    @PostMapping
    public Result<Object> addUser(UmsSysUser uer){
        boolean save = umsSysUserService.save(uer);
        if(save){
            return Result.success("添加成功");
        }else {
            return Result.error("添加失败", HttpStatus.NO_CONTENT);
        }
    }
    /**
     * 新增用户
     */
    @GetMapping
    public Result<List<UmsSysUser>> list(){
        List<UmsSysUser> list = umsSysUserService.list();
        return Result.success(list);
    }





    /**
     * 查询用户
     */


    /**
     * 删除用户
     */



    /**
     * 修改用户
     */

    /**
     * 根据id回写用户数据
     */



}

